package com.heima.user.feign;

import com.heima.apis.apUser.IApUserClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import com.heima.user.service.ApUserRealnameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * APP实名认证信息表 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class ApUserClient implements IApUserClient {
    @Autowired
    private ApUserRealnameService userRealnameService;

    /**
     * 查看用户审核列表
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/auth/list")
    public ResponseResult getAuthList(@RequestBody AuthDto dto){
        return userRealnameService.getList(dto);
    };

    /**
     * 审核失败,修改状态
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/auth/authFail")
    public ResponseResult  authFail(@RequestBody AuthDto dto){
        return userRealnameService.authFail(dto);
    };

    /**
     * 审核成功,修改状态
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/auth/authPass")
    public ResponseResult  authPass(@RequestBody AuthDto dto){
        return userRealnameService.authPass(dto);
    };
}
